#define _CRT_SECURE_NO_WARNINGS 1
void reverse(int* nums, int start, int end)
{

    while (start < end)
    {
        int temp = nums[start];
        nums[start] = nums[end];
        nums[end] = temp;
        start++;
        end--;
    }
}

void rotate(int* nums, int numsSize, int k)
{

    k %= numsSize;
    reverse(nums, 0, numsSize - 1);
    reverse(nums, k, numsSize - 1);
    reverse(nums, 0, k - 1);

}

int missingNumber(int* nums, int numsSize)
{

    int ret = 0;
    for (int i = 1; i <= numsSize; i++)
    {
        ret ^= i;
    }

    for (int i = 0; i < numsSize; i++)
    {
        ret ^= nums[i];
    }

    return ret;

}